package com.stockz.ui.swing.widget;

import javax.swing.Action;
import javax.swing.Icon;

import com.stockz.ui.resource.image.ImageIconLoader;
import com.stockz.ui.swing.charting.util.SwingUtil;

public class JButton extends javax.swing.JButton{
	private static final long serialVersionUID = -7390254747720682115L;

	private Object payload;
	
	public JButton() {
		super();
		SwingUtil.initializeWidget(this);
	}

	public JButton(Action a) {
		this();
		setAction(a);
	}

	public JButton(Icon icon) {
		this();
		setIcon(icon);
	}

	public JButton(String text, Icon icon) {
		this();
		setText(text);
		setIcon(icon);
	}

	public JButton(String text,  String iconPath){
		this(text);
		setIcon(ImageIconLoader.loadImageIcon(iconPath));
	}
	
	public JButton(String text) {
		this();
		setText(text);
	}

	public JButton(Object payload){
		this.payload = payload;
	}

	public Object getPayload() {
		return payload;
	}

	public void setPayload(Object payload) {
		this.payload = payload;
	}
	
}
